package Control;

import GameControl.GameControl;
import GameControl.GameState;
import Main.Main;

/**
 * Class <code>Controller</code> stores current controller state.
 * @author hun10
 */
public class Controller {

    /**
     * Current controller ID. It shouldn't be mutated after the participant has
     * been registered.
     */
    static public String selfID;
    /**
     * Controller SwimLines.
     */
    static protected SwimLines swim;

    /**
     * Initializes controller state and makes itself a participant.
     */
    static public void Initialize() {
        GameControl.setState(new GameState());
        swim = new SwimLines();
        swim.addParticipant(selfID);
        Debug("initialized");
    }

    /**
     * Writes debug message via <code>Main.PrintDebug</code>.
     * @param txt text to be written
     */
    static protected void Debug(String txt) {
        Main.PrintDebug(3, "Controller: " + txt);
    }

    /**
     * Writes messages about serious problems via <code>Main.PrintDebug</code>.
     * @param txt text to be written
     */
    static protected void Serious(String txt) {
        Main.PrintDebug(8, "Controller: " + txt);
    }
}
